package com.onesports.common;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @Author: HUANG GY.
 * @Date: 2020/6/19 16:30
 * @Description: com.onesports.common
 */
public class MessageUtil {

    /**
     *  生成消息id
     * @param bizCode 业务主键
     * @return
     */
    public static String createMsgId(@NotNull String bizCode){
        String msgId = getNowTime().concat(bizCode);
        return msgId;
    }

    /**
     *  生成消息id
     * @return
     */
    public static String createMsgId(){
        return createMsgId("");
    }

   /**
     *  获取当前时间
     * @return
     */
    public static String getNowTime(){
        return LocalDateTime.now().toString();
    }

}
